Page({
  data: {
    questionId: null,
    questionDetail: {},
    replies: [
      {
        replyId: 1,
        userName: "心理咨询师小王",
        replyTime: "2024-01-08 20:27",
        content: "这种情况是很常见的，建议可以..."
      },
      {
        replyId: 2,
        userName: "用户12345",
        replyTime: "2024-01-08 20:27",
        content: "我也遇到过类似的问题，后来是这样解决的..."
      },
      {
        replyId: 3,
        userName: "心理专家张医生",
        replyTime: "2024-01-08 20:27",
        content: "从专业角度来看，这个问题需要注意以下几点..."
      }
    ],
    replyContent: ''
  },

  onLoad(options) {
    const { id } = options;
    this.setData({ questionId: id });
    this.loadQuestionDetail(id);
  },

  loadQuestionDetail(id) {
    // 这里应该发送请求获取问题详情
    // 暂时使用模拟数据
    this.setData({
      questionDetail: {
        questionTitle: "会哭得孩子有奶吃，但感觉哭错地方了，别扭......",
        consultantName: "老司机",
        publishTime: "2024-01-08 20:27",
        content: "最近在学习这门课程，遇到了一些问题，希望能得到解答..."
      }
    });
  },

  submitReply() {
    if (!this.data.replyContent.trim()) {
      wx.showToast({
        title: '请输入回复内容',
        icon: 'none'
      });
      return;
    }

    // 这里应该发送请求提交回复
    wx.showToast({
      title: '回复成功',
      icon: 'success'
    });
    this.setData({ replyContent: '' });
  }
}); 